/*
csyingwu
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace Kaidou.Model
{

	/// <summary>
	/// ITrnReportSeal interface for NHibernate mapped table 'trn_report_seal'.
	/// </summary>
	public interface ITrnReportSeal
	{
		#region Public Properties
		
		int SealNoId
		{
			get ;
			set ;
		}
		
		int RptSealSeqno
		{
			get ;
			set ;
		}
		
		string SealNo
		{
			get ;
			set ;
		}
		
		string UnionCode
		{
			get ;
			set ;
		}
		
		short BranchCode
		{
			get ;
			set ;
		}
		
		string TraderRegNo
		{
			get ;
			set ;
		}
		
		string ReportNo
		{
			get ;
			set ;
		}
		
		string ReportRegNo
		{
			get ;
			set ;
		}
		
		string DupErrorFlg
		{
			get ;
			set ;
		}
		
		string DifReportFlg
		{
			get ;
			set ;
		}
		
		string MachineClss
		{
			get ;
			set ;
		}
		
		string ReportSealSts
		{
			get ;
			set ;
		}
		
		DateTime RegDate
		{
			get ;
			set ;
		}
		
		DateTime UpdDate
		{
			get ;
			set ;
		}
		
		string UpdUnionCode
		{
			get ;
			set ;
		}
		
		short UpdBranchCode
		{
			get ;
			set ;
		}
		
		string UpdFuncId
		{
			get ;
			set ;
		}
		
		bool IsDeleted { get; set; }
		bool IsChanged { get; set; }
		
		#endregion 
		#region Serialize
		/// <summary>
		/// Method for entity class serialization to XML file
		/// </summary>
		/// <param name="pXMLFilePath">Path of the XML file to write to. Will be overwritten if already exists.</param>
		void SerializeToFile( string pXMLFilePath );
		
		/// <summary>
		/// Method for entity class deserialization from XML file. Does not change this object content but returns another deserialized object instance
		/// </summary>
		/// <param name="pXMLFilePath">Path of the XML file to read from.</param>
		/// <returns>TrnReportSeal object restored from XML file</returns>
		TrnReportSeal DeserializeFromFile( string pXMLFilePath );
		
		#endregion
		
		
	}

	/// <summary>
	/// TrnReportSeal object for NHibernate mapped table 'trn_report_seal'.
	/// </summary>
	[Serializable]
	public class TrnReportSeal : ITrnReportSeal
	{
		#region Member Variables

		protected int _sealNoId;
		protected int _rptSealSeqno;
		protected string _sealNo;
		protected string _unionCode;
		protected short _branchCode;
		protected string _traderRegNo;
		protected string _reportNo;
		protected string _reportRegNo;
		protected string _dupErrorFlg;
		protected string _difReportFlg;
		protected string _machineClss;
		protected string _reportSealSts;
		protected DateTime _regDate;
		protected DateTime _updDate;
		protected string _updUnionCode;
		protected short _updBranchCode;
		protected string _updFuncId;
		protected bool _isDeleted;
		protected bool _isChanged;
		#endregion
		
		#region Constructors
		public TrnReportSeal() {}
		
		public TrnReportSeal(int sealNoId, int rptSealSeqno, string sealNo, string unionCode, short branchCode, string traderRegNo, string reportNo, string reportRegNo, string dupErrorFlg, string difReportFlg, string machineClss, string reportSealSts, DateTime regDate, DateTime updDate, string updUnionCode, short updBranchCode, string updFuncId)
		{
			this._sealNoId = sealNoId; /*c*/ 
			this._rptSealSeqno = rptSealSeqno; /*c*/ 
			this._sealNo = sealNo; /*c*/ 
			this._unionCode = unionCode; /*c*/ 
			this._branchCode = branchCode; /*c*/ 
			this._traderRegNo = traderRegNo; /*c*/ 
			this._reportNo = reportNo; /*c*/ 
			this._reportRegNo = reportRegNo; /*c*/ 
			this._dupErrorFlg = dupErrorFlg; /*c*/ 
			this._difReportFlg = difReportFlg; /*c*/ 
			this._machineClss = machineClss; /*c*/ 
			this._reportSealSts = reportSealSts; /*c*/ 
			this._regDate = regDate; /*c*/ 
			this._updDate = updDate; /*c*/ 
			this._updUnionCode = updUnionCode; /*c*/ 
			this._updBranchCode = updBranchCode; /*c*/ 
			this._updFuncId = updFuncId; /*c*/ 
		}
		
		#endregion
		
		
		
		#region Public Properties
		
		public int SealNoId
		{
			get { return _sealNoId; }
			set { _isChanged |= (_sealNoId != value); _sealNoId = value; }
		}
		
		public int RptSealSeqno
		{
			get { return _rptSealSeqno; }
			set { _isChanged |= (_rptSealSeqno != value); _rptSealSeqno = value; }
		}
		
		public string SealNo
		{
			get { return _sealNo; }
			set { _isChanged |= (_sealNo != value); _sealNo = value; }
		}
		
		public string UnionCode
		{
			get { return _unionCode; }
			set { _isChanged |= (_unionCode != value); _unionCode = value; }
		}
		
		public short BranchCode
		{
			get { return _branchCode; }
			set { _isChanged |= (_branchCode != value); _branchCode = value; }
		}
		
		public string TraderRegNo
		{
			get { return _traderRegNo; }
			set { _isChanged |= (_traderRegNo != value); _traderRegNo = value; }
		}
		
		public string ReportNo
		{
			get { return _reportNo; }
			set { _isChanged |= (_reportNo != value); _reportNo = value; }
		}
		
		public string ReportRegNo
		{
			get { return _reportRegNo; }
			set { _isChanged |= (_reportRegNo != value); _reportRegNo = value; }
		}
		
		public string DupErrorFlg
		{
			get { return _dupErrorFlg; }
			set { _isChanged |= (_dupErrorFlg != value); _dupErrorFlg = value; }
		}
		
		public string DifReportFlg
		{
			get { return _difReportFlg; }
			set { _isChanged |= (_difReportFlg != value); _difReportFlg = value; }
		}
		
		public string MachineClss
		{
			get { return _machineClss; }
			set { _isChanged |= (_machineClss != value); _machineClss = value; }
		}
		
		public string ReportSealSts
		{
			get { return _reportSealSts; }
			set { _isChanged |= (_reportSealSts != value); _reportSealSts = value; }
		}
		
		public DateTime RegDate
		{
			get { return _regDate; }
			set { _isChanged |= (_regDate != value); _regDate = value; }
		}
		
		public DateTime UpdDate
		{
			get { return _updDate; }
			set { _isChanged |= (_updDate != value); _updDate = value; }
		}
		
		public string UpdUnionCode
		{
			get { return _updUnionCode; }
			set { _isChanged |= (_updUnionCode != value); _updUnionCode = value; }
		}
		
		public short UpdBranchCode
		{
			get { return _updBranchCode; }
			set { _isChanged |= (_updBranchCode != value); _updBranchCode = value; }
		}
		
		public string UpdFuncId
		{
			get { return _updFuncId; }
			set { _isChanged |= (_updFuncId != value); _updFuncId = value; }
		}
		

		public bool IsDeleted
		{
			get { return _isDeleted; }
			set { _isDeleted = value; }
		}
		
		public bool IsChanged
		{
			get { return _isChanged; }
			set { _isChanged = value; }

		}
		
		#endregion 
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			TrnReportSeal castObj = null;
			try
			{
				castObj = (TrnReportSeal)obj;
			} catch(Exception) { return false; } 
			return (castObj != null) &&
				( this._rptSealSeqno == castObj.RptSealSeqno );
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
		  
			
			int hash = 57; 
			hash = 27 * hash * _rptSealSeqno.GetHashCode(); /*c*/
			return hash; 
		}
		#endregion
		
		#region Serialize
		/// <summary>
		/// Method for entity class serialization to XML file
		/// </summary>
		/// <param name="pXMLFilePath">Path of the XML file to write to. Will be overwritten if already exists.</param>
		public virtual void SerializeToFile( string pXMLFilePath )
		{
			System.Xml.Serialization.XmlSerializer seriliaser = new System.Xml.Serialization.XmlSerializer( this.GetType() );
			using(System.IO.TextWriter txtWriter = new System.IO.StreamWriter( pXMLFilePath ))
			{
				seriliaser.Serialize(txtWriter, this);
				txtWriter.Close();
			}
		}
		/// <summary>
		/// Method for entity class deserialization from XML file. Does not change this object content but returns another deserialized object instance
		/// </summary>
		/// <param name="pXMLFilePath">Path of the XML file to read from.</param>
		/// <returns>TrnReportSeal object restored from XML file</returns>
		public virtual TrnReportSeal DeserializeFromFile( string pXMLFilePath )
		{
			TrnReportSeal _result = null;
			
			System.Xml.Serialization.XmlSerializer seriliaser = new System.Xml.Serialization.XmlSerializer( this.GetType() );
			using(System.IO.TextReader txtReader = new System.IO.StreamReader( pXMLFilePath ))
			{
				_result = (TrnReportSeal)seriliaser.Deserialize( txtReader );
				txtReader.Close();
			}
			return _result;
		}
		#endregion
		
		
	}
	
	#region Custom ICollection interface for TrnReportSeal 

	
	public interface ITrnReportSealCollection : ICollection
	{
		TrnReportSeal this[int index]{	get; set; }
		void Add(TrnReportSeal pTrnReportSeal);
		void Clear();
	}
	
	[Serializable]
	public class TrnReportSealCollection : ITrnReportSealCollection
	{
		private IList<TrnReportSeal> _arrayInternal;

		public TrnReportSealCollection()
		{
			_arrayInternal = new List<TrnReportSeal>();
		}
		
		public TrnReportSealCollection( IList<TrnReportSeal> pSource )
		{
			_arrayInternal = pSource;
			if(_arrayInternal == null)
			{
				_arrayInternal = new List<TrnReportSeal>();
			}
		}

		public TrnReportSeal this[int index]
		{
			get
			{
				return _arrayInternal[index];
			}
			set
			{
				_arrayInternal[index] = value;
			}
		}

		public int Count { get { return _arrayInternal.Count; } }
		public bool IsSynchronized { get { return false; } }
		public object SyncRoot { get { return _arrayInternal; } }
		public void CopyTo(Array array, int index){ _arrayInternal.CopyTo((TrnReportSeal[])array, index); }
		public IEnumerator GetEnumerator() { return _arrayInternal.GetEnumerator(); }
		public void Add(TrnReportSeal pTrnReportSeal) { _arrayInternal.Add(pTrnReportSeal); }
		public void Clear() { _arrayInternal.Clear(); }
		public IList<TrnReportSeal> GetList() { return _arrayInternal; }
	 }
	
	#endregion
}
